package org.jeecg.cn.edu.scau.vm.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

@Configuration
public class ThreadPoolExecutorConfig {
    /**
     * @return 读取SSH连接信息线程池
     */
    @Bean("readStreamThreadPool")
    public ThreadPoolExecutor readStreamThreadPool() {
        return new ThreadPoolExecutor(
                3,
                6,
                400, TimeUnit.MICROSECONDS,
                new ArrayBlockingQueue<>(100)
        );
    }

    @Bean("syncDataThreadPool")
    public ThreadPoolExecutor syncDataThreadPool() {
        return new ThreadPoolExecutor(
                3,
                6,
                400, TimeUnit.MICROSECONDS,
                new ArrayBlockingQueue<>(100)
        );
    }


}